<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateNewsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('news', function(Blueprint $table)
		{
			$table->increments('id');
			$table->timestamps();


			//varchar 255 资讯标题
			$table->string('title');
			//text 资讯简介
			$table->text('description');
			//text 资讯内容
			$table->text('content');
			//varchar 255 图片名称，该图片为缩略图
			$table->string('image_name');
			//tinyint 2 是否推荐，将显示在资讯列表前几条
			$table->tinyInteger('is_recommanded');
			//int 11 推荐的顺序，数字越大 越靠前
			$table->integer('news_rank');
			//tinyint 资讯类别 0为资讯新闻 1为开发区 2为机构与业绩 4为碳排放资讯
			$table->tinyInteger('type');
			$table->integer('uid');
			$table->timestamp('create_time');
			$table->integer("is_rec_right");
			$table->softDeletes();

		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('news');
	}

}
